package org.qsoft.ext;

/**
 * @author kk
 *
 */
public class FileUploadConfigImpl implements IFileUploadConfig {

	private String localDir;
	private String tempDir;
	private String types;
	private long maxSize;

	public String getLocalDir() {
		return localDir;
	}

	public void setLocalDir(String localDir) {
		this.localDir = localDir;
	}

	public void setTempDir(String tempDir) {
		this.tempDir = tempDir;
	}

	public String getTypes() {
		return types;
	}

	public void setTypes(String types) {
		this.types = types;
	}

	public long getMaxSize() {
		return maxSize;
	}

	public void setMaxSize(long maxSixe) {
		this.maxSize = maxSixe;
	}

	public String convertFilename(String orgFilename) {
		String ext = new String ();
		int pos = orgFilename.lastIndexOf(".");
		if (pos != -1) {
			ext = orgFilename.substring(pos);
		} else
			ext = orgFilename;
		long mills = System.currentTimeMillis();
		return mills + ext;
	}

	public String getTempDir() {
		return tempDir;
	}

}
